
#include "doubleLinkedList.h"
int main(int argc, char *argv[])
{
    ND *head = createList();
    if (!isEmpty(head))
    {
        puts("empty");
    }
    for (size_t i = 0; i < 10; i += 2)
    {
        insertNodeHead(head, i);
    }
    showList(head);
    for (size_t i = 1; i < 10; i += 2)
    {
        insertNodeTail(head, i);
    }
    for (size_t i = 1; i < 10; i += 2)
    {
        insertNodeTail(head, 99);
    }
    showList(head);
    changeVal(head, 99, 99);
    changeVal(head, 99, 88);
    showList(head);
    ND *temp = selectVal(head, 49);
    if (NULL == temp)
    {
        puts("NULL :not found");
    }
    else
    {
        printf("select : %d\n", temp->data);
    }
    showList(head);
    delVal(head, 88);
    delVal(head, 8);
    showList(head);
    printf("length:%d\n", listLen(head));
    // initList0(head);
    initList1(head);
    if (!isEmpty(head))
    {
        puts("empty");
    }
    insertNodeTail(head, 99);
    showList(head);
    freeList(&head);
    showList(head);
    return 0;
}
